﻿using System.Web;
using System.Web.Optimization;

namespace NCLCustomerManagement.UI
{
    public class BundleConfig
    {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));

            bundles.Add(new StyleBundle("~/jqueryui/css").Include("~/Content/themes/cupertino/jquery-ui-{version}.custom.css"));
            bundles.Add(new ScriptBundle("~/jqueryui/js").Include(
                        //"~/Scripts/jquery-ui-{version}.js",
                        "~/Scripts/jquery-ui-{version}.custom.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));

            // Use the development version of Modernizr to develop with and learn from. Then, when you're
            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));

            bundles.Add(new StyleBundle("~/css/main").Include("~/Content/css/style.css"));

            bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                        "~/Content/themes/base/jquery.ui.core.css",
                        "~/Content/themes/base/jquery.ui.resizable.css",
                        "~/Content/themes/base/jquery.ui.selectable.css",
                        "~/Content/themes/base/jquery.ui.accordion.css",
                        "~/Content/themes/base/jquery.ui.autocomplete.css",
                        "~/Content/themes/base/jquery.ui.button.css",
                        "~/Content/themes/base/jquery.ui.dialog.css",
                        "~/Content/themes/base/jquery.ui.slider.css",
                        "~/Content/themes/base/jquery.ui.tabs.css",
                        "~/Content/themes/base/jquery.ui.datepicker.css",
                        "~/Content/themes/base/jquery.ui.progressbar.css",
                        "~/Content/themes/base/jquery.ui.theme.css"));

            RegisterBootstrapBundles(bundles);
            RegisterLoginBundles(bundles);
            RegisterJqGridBundles(bundles);
            RegisterScrollbarBundles(bundles);
            RegisterOtherBundles(bundles);
        }

        private static void RegisterBootstrapBundles(BundleCollection bundles)
        {
            // Bootstrap
            bundles.Add(new StyleBundle("~/bootstrapv3/css").Include(
                        "~/Addon/bootstrapv3/css/bootstrap.css"));
            bundles.Add(new ScriptBundle("~/bootstrapv3/js").Include(
                       "~/Addon/bootstrapv3/js/bootstrap.js"));

            // For disabling non responsive feature
            bundles.Add(new StyleBundle("~/bootstrapv3/css/nonresponsive").Include(
                        "~/Addon/bootstrapv3/css/non-responsive.css"));
        }

        private static void RegisterLoginBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/login/js").Include(
                      "~/Scripts/User/Login.js"));
        }

        private static void RegisterJqGridBundles(BundleCollection bundles)
        {
            bundles.Add(new StyleBundle("~/jqgrid/css").Include(
                        "~/Addon/jqGrid4.4.1/css/ui.jqgrid.css"));
            bundles.Add(new ScriptBundle("~/jqgrid/js")               
               .Include("~/Addon/jqGrid4.4.1/js/grid.locale-en.js",
                        "~/Addon/jqGrid4.4.1/js/jquery.jqGrid-{version}.js",
                        "~/Scripts/CommandGrid.js"));

        }

        private static void RegisterScrollbarBundles(BundleCollection bundles)
        {
            bundles.Add(new StyleBundle("~/scroll/css").Include(
                        "~/Addon/scrollbar/css/jquery.mCustomScrollbar.css"));
            bundles.Add(new ScriptBundle("~/scroll/js")
               .Include("~/Addon/scrollbar/js/jquery.mCustomScrollbar.concat.js"));

        }

        private static void RegisterOtherBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/others").Include(
                "~/Scripts/jquery.blockUI.js",
                "~/Scripts/PopupWindow.js",
                "~/Scripts/json2.js",
                "~/Scripts/Alert.js"));
        }
    }
}